checkStringNotEmpty

open fun <T : CharSequence?> checkStringNotEmpty(@Nullable string: @Nullable T): @NonNull T(source)

Ensures that an string reference passed as a parameter to the calling method is not empty.

Return

the string reference that was validated

Parameters

string

an string reference

Throws

if string is empty


open fun <T : CharSequence?> checkStringNotEmpty(@Nullable string: @Nullable T, @NonNull errorMessage: @NonNull Any): @NonNull T(source)

Ensures that an string reference passed as a parameter to the calling method is not empty.

Return

the string reference that was validated

Parameters

string

an string reference

errorMessage

the exception message to use if the check fails; will be converted to a string using valueOf

Throws

if string is empty


open fun <T : CharSequence?> checkStringNotEmpty(@Nullable string: @Nullable T, @NonNull messageTemplate: @NonNull String, messageArgs: @NonNull Array<Any>): @NonNull T(source)

Ensures that an string reference passed as a parameter to the calling method is not empty.

Return

the string reference that was validated

Parameters

string

an string reference

messageTemplate

a printf-style message template to use if the check fails; will be converted to a string using format

messageArgs

arguments for messageTemplate

Throws

if string is empty